package com.ParkingManager.app.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Objects;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.ParkingManager.app.bean.Parking;
import com.ParkingManager.app.bean.User;

@Repository
@Mapper
public interface UserMapper {
	//遍历
	public List<HashMap> getUser();
	
	// 登录
	public int login(User user);
	
	//插入
	public boolean insertUser(@Param("userName") String userName,
			@Param("password") String password,
			@Param("userType") int userType,
			@Param("parkingId")String parkingId);
	
	//更新
	public boolean updateUser(@Param("userName") String userName,
			@Param("parkingId")String parkingId);
	
	//删除（根据用户名）
	public boolean deleteUser(@Param("userName")String userName);  
	
	//统计
	public int getCountUser();
	
	//搜索by停车场名
	public List<HashMap<String,Object>> searchByPname(@Param("pName")String pName);
	
	//搜索by停车场id
	public List<HashMap<String,Object>> searchByPid(@Param("pid")int pid);
	
	//搜索by门卫
	public List<HashMap<String,Object>> searchByUser(@Param("uName")String uName); 
}
